<?php  if ( ! defined('BASEPATH')) exit('No direct script access allowed');
/*-----------------------------------------------------------------------------------------------
get_products_block()
-----------------------------------------------------------------------------------------------*/
class Get_promotion_course_block extends Front_Controller{

	function Get_promotion_course_block(){
        parent::Front_Controller();
		$CI = &get_instance();
		//$CI->load->module_language('blocks.block','english');
		
	}
	
	function index(){
        $CI = &get_instance();
		$CI->db->select('c.*,cust.'.CUSTOMERS_IMAGE);
		$CI->db->from(COURSES.' c');		
		$CI->db->join(CUSTOMERS.' cust', 'c.'.COURSES_PROVIDER_ID.' = cust.'.CUSTOMERS_CUSTOMER_ID);		
		$CI->db->where(COURSES_PROMOTION,1);
		$q = $CI->db->get();
		$courses = $q->result();
			
		$course_image = base_url().'application/assets/products/1/editor/images/'; 
		$course_image_thumb = base_url().'application/assets/products/1/editor/images/thumb/'; 			
		$this->add('courses', $courses);
		$this->add('course_image', $course_image);
		$this->add('course_image_thumb', $course_image_thumb);
        $this->view('get_hot_course_block');
		
	}
	/*
	function detail(){
		$CI = &get_instance();
		$product_id = (int)$CI->uri->segment(3);
		if($product_id){
			$product_image = base_url().'application/assets/products/1/editor/images/'; 
			$product_image_thumb = base_url().'application/assets/products/1/editor/images/thumb/'; 
			$CI->load->module_model('blocks.products_model');
			$product = $CI->products_model->get_by_id($product_id);
			$this->add('product', $product);
			$this->add('product_image', $product_image);
			$this->add('product_image_thumb', $product_image_thumb);
		}
		else{
			$this->add('message',$CI->lang->line('not_found'));
			$this->view('get_blank_block');
			return false;
		}
        $this->view('get_product_detail');
	
	}
	*/
}